package com.myinternet.lutu.controller;

import com.myinternet.lutu.modal.LessJsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("redis")
public class RedisController {
    @Autowired
    private StringRedisTemplate strRedis;

    @RequestMapping("/setRedis")
    public LessJsonResult setRedis() {
        strRedis.opsForValue().set("lutu", "路途前端");
        return LessJsonResult.ok(strRedis.opsForValue().get("lutu"));
    }
}
